//
//  PublicWelfareController.m
//  QuickCure37
//
//  Created by 马文星 on 16/6/28.
//  Copyright © 2016年 Demos. All rights reserved.
//

#import "PublicWelfareController.h"

@interface PublicWelfareController () <UIWebViewDelegate>

@property (nonatomic, strong) UIWebView *webview;

@end

@implementation PublicWelfareController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = @"公益";
    self.automaticallyAdjustsScrollViewInsets = NO;

    self.webview.backgroundColor = WHITE_COLOR;
    
    [self setupUI];
    [self loadData];
}

-(void)setupUI{


    [self.view addSubview:self.webview];
    
    
    [self.webview mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.right.top.bottom.mas_equalTo(0);
        
    }];
}

- (void)loadData{

    
    NSString *urlString = @"http://202.106.210.115:18080/hyde-pluto-h360/nt/appEntrance.htm";

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];
    
    [self.webview loadRequest:request];
     [SVPAlertManager alertLoading];
}

#pragma mark  - UIWebViewDelegate
- (void)webViewDidFinishLoad:(UIWebView *)webView{


    [SVPAlertManager dismissLoading];
}

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{

    [SVPAlertManager dismissLoading];
}



#pragma mark  - Lazy
-(UIWebView *)webview{
    
    if (_webview == nil) {
        _webview = [[UIWebView alloc] init];
        _webview.delegate  = self;
    }
    return _webview;
}


@end
